473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Why <intput> tag overwrite the <td> tag

RC
I have a very sime html table like
<html><head><title>My Table</title>
<style>
input { margin: 0; padding: 0; border-width: 0;
text-indet: 0; text-align: left }
</style></head><body>

<table border="1" width="100%">
<caption>Table Title</caption>
<tr>
<th width="25%">Col1></th>
<th width="25%">col2</th>
<th width="25%">col3</th>
<th width="25%">col4</th>
</tr>

<tr>
<td width="25%">
<input type="text" name="name1" value="" size="2" />
</td>
<td width="25%">
<input type="text" name="name2" value="" size="2" />
</td>
<td width="25%">
<input type="text" name="name3" value="" size="2" />
</td>
<td width="25%">
<input type="text" name="name4" value="" size="2" />
</td>
</tr>

</table></body></html>

Everything is fine, except the table width is over 100% of window
browser width, the browser auto have a horizontal scroll bar at bottom.
So I can only see 80% of the table, need to scroll the horizontal scroll
bar right and left.

I have 17" LCD screen with 1280x1024 resolution, it is wide enough
for a such small table maximum length only 8 characters.

If I take out all the <input> tags inside the <td> tags, then I got
exactly what I want, 100% table show on the browser window without the
horizontal scrolling bar.

Why the <input> tag increase the width of <td> tag?
How can I see the 100% of table on browser window?

Thank Q very much in advance!

P.S. the reason I posted this in XML group.
Because this is XSLT convert from XML to HTML
Oct 6 '05 #1
3 1161

RC skrev:
I have a very sime html table like
<html><head><title>My Table</title>
<style>
input { margin: 0; padding: 0; border-width: 0;
text-indet: 0; text-align: left }
</style></head><body>

<table border="1" width="100%">
<caption>Table Title</caption>
<tr>
<th width="25%">Col1></th>
<th width="25%">col2</th>
<th width="25%">col3</th>
<th width="25%">col4</th>
</tr>

<tr>
<td width="25%">
<input type="text" name="name1" value="" size="2" />
</td>
<td width="25%">
<input type="text" name="name2" value="" size="2" />
</td>
<td width="25%">
<input type="text" name="name3" value="" size="2" />
</td>
<td width="25%">
<input type="text" name="name4" value="" size="2" />
</td>
</tr>

</table></body></html>

Everything is fine, except the table width is over 100% of window
browser width, the browser auto have a horizontal scroll bar at bottom.
So I can only see 80% of the table, need to scroll the horizontal scroll
bar right and left.

I have 17" LCD screen with 1280x1024 resolution, it is wide enough
for a such small table maximum length only 8 characters.

If I take out all the <input> tags inside the <td> tags, then I got
exactly what I want, 100% table show on the browser window without the
horizontal scrolling bar.

Why the <input> tag increase the width of <td> tag?
How can I see the 100% of table on browser window?

Thank Q very much in advance!

P.S. the reason I posted this in XML group.
Because this is XSLT convert from XML to HTML

Could it have something to do with your additional > after Col1 in this
line:
<th width="25%">Col1></th>
Otherwise, I don't seem to have any problem viewing the table in any
resolution.

Oct 6 '05 #2
Xandax wrote:
RC skrev:
I have a very sime html table like
Sime? Simple?
input { margin: 0; padding: 0; border-width: 0;
text-indet: 0; text-align: left }
text-indet is not valid CSS.
<th width="25%">Col1></th>

The extra > makes no difference to my browser.
Could it have something to do with your additional > after Col1 in this
line:
<th width="25%">Col1></th>
Otherwise, I don't seem to have any problem viewing the table in any
resolution.


I see it functioning correctly, even after I removed the invalid CSS
(and that >). Firefox 1.0.7

Methinks the OP is not telling the whole story. URL please?

--
-bts
-When motorcycling, never follow a pig truck
Oct 6 '05 #3
RC wrote:
I have a very sime html table like
[...]
Everything is fine, except the table width is over 100% of window
browser width, the browser auto have a horizontal scroll bar at bottom.
So I can only see 80% of the table, need to scroll the horizontal scroll
bar right and left.

It works fine here even after adding a DOCTYPE. Mozilla v1.7.12.
What browser are you using?
Post an URL demonstrating the problem.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Oct 6 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: RC | last post by:
I have a very sime html table like <html><head><title>My Table</title> <style> input { margin: 0; padding: 0; border-width: 0; text-indet: 0; text-align: left } </style></head><body> <table...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.