Jump to content

HTML/CSS Table Row Height


tinfanide
 Share

Recommended Posts

Surfing online and finding the codes, I tried both html and css ways to fix a height for the "What's new?" row. It still doesn't show any effects changed.I added the div tag on the table tag, just for convenience to style the table.Anybody could help? I'd burnt my midlight oil to change such little things like the width and height and the table!!! :) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>marquee</title><style type="text/css">.marquee { float:right; overflow:auto; }a:visit {color:#30F;}a:hover {color:#F90; text-decoration:none;}.HKIEdcampus { float:left; overflow:auto;}</style></head><body><div class="marquee" style="border-width:5px; border-style:groove; border-color:red"><table border=3 style="table-layout:fixed; height:500px;"><tr style="height:30px"><th colspan=2><p style="text-align:center; font-size:28px; padding:1%"><strong>What's <em>New</em>?</strong></p></th></tr><tr style="height:450px"><td colspan=2><marquee id="scroller" onMouseover="this.scrollAmount=2" onMouseout="this.scrollAmount=6" align="right" behavior="scroll" direction="up" width="250" height="500" style="font-size:24pt; font-weight:bold;"><center><a href="http://www.ied.edu.hk/bme/seminar.html" style="text-decoration:none; font-size:20px" target="_blank"><strong>BME Seminars</strong></a></center></marquee></td></tr><tr style="height:20px"><td colspan="2" width="70"><input type="button" value="MOVE" onClick="java script:scroller.start()" style="position:relative; left:17%" /><input type="button" value="HOLD" onClick="java script:scroller.stop()" style="position:relative; right:-33%" /></td></tr></table></div><img class="HKIEdcampus" src="http://www.ied.edu.hk/bme/pic/Campus/2.jpg" width="549" height="411" /></body></html>

Link to comment
Share on other sites

If you use 4.01 Transitional Document type you can just give each cell a height like:<td height="50px"></td>That always works for me although it may not be the best way to do it. I have found it nearly impossible to get a <td> to maintain a fixed height. If you want a fixed height save yourself hours of grief and use a <div>.

Link to comment
Share on other sites

You should just completely get rid of the table. You can use <div> elements and CSS for the whole thing.In most of the occasions where it's actually OK to use a table, it doesn't matter what size the cells have because the table is simply representing the tabular data.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...