Td Taking Up Entire Width Of Row
Solution 1:
You can use style="display:inline-block"
in this case and use float:left
as Leo Abraham has stated.
Solution 2:
You have an uneven number of columns in each row. On td
elements that you wish to span both columns, specify a colspan
attribute of the number of columns to be spanned.
<tdalign="center"style="text-align:center;"width="600"colspan="2">
Edit:
Without this colspan
attribute, each subsequent row's first column is assuming the width of the widest cell in the column - in this case the 600px wide first column of the first row.
Solution 3:
Solution 4:
I just wanted to state that td width has depreciated in HTML5. I recommend the use of css.
td { width:244px; }
Solution 5:
Try adding this style to your table.
table-layout:fixed;
The default value is "auto" which I think is (weird) updated behavior, compared to the classic way of doing tables from 1994-2004.
https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout
I'm still not sure why "auto" forces a "td" to take up an entire row, when then content is much smaller than the width of the table. Does the "auto" engine have some glitches or weird behavior? Not sure.
Post a Comment for "Td Taking Up Entire Width Of Row"