Jump to content
groads2

How do i prevent the <th> from filling the whole table when no data rows?

Recommended Posts

I had an html form that has several tables. Sometime there is no xml data to file the table with and the table is filled entirely with the <tr> row that has the <th>. I need the row containing the <th> to maintain a size of 20px and not consume the entire table when there are no data rows.this is an example of what I am refering too.

<html><head></head><body><div style="border:1px solid red;width:600px;height:400px"><table style="border:1px solid blue;width:300px;height:200px"><tr style="height:10px"><th style="text-align:center;background-color:blue;height:10px">header</th></tr></table><div></body></html>

Share this post


Link to post
Share on other sites

Thats what it will do?,being a single row it will full the entire width/height defined by the height set by the parent table element. consider using max-height:200px; instead.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...