Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!
HTML table question:
This is for a web application that only runs on IE. Currently I'm testing it on IE8.
I define a table like so:
<table frame="box" width="100%" align="center" rules="none" >
The problem is the table border has that 3-D effect, which we don't want. All we want is a one-pixel wide border around a table.
When I try this:
<table frame="box" width="100%" align="center" rules="none" border="1" >
or this:
<table frame="box" width="100%" align="center" rules="none" border="1" style="border-style: solid">
I still get the 3-D border effect. I would think that specifying a border one-pixel wide would result in a one-pixel wide, non-3D border, but no. Do I need to define something in a stylesheet?
What happens when you take out the frame= and border= attributes, and keep the style= attribute?
Doing this:
<table width="100%" align="center" rules="none" style="border-style: solid">
has the same problem.
When I do just the style thing:
<table style="border-style: solid">
there's no 3-D effect. The border is solid but not black, and looks to be 3 or 4 pixels wide.
My boss said we could go with that for now.
Thanks!
try style="border-style: solid; border-width: 1px"
or style="border: 1px solid"
try style="border-style: solid; border-width: 1px"
That works! But it's hard to see when the border is gray.
But my boss decided he likes it better with a gray, 3px border instead of the black 1px border we were going for.
(or style="border: 1px solid black") (or 6px dashed #ff0000) (or...) Generally, using the style attribute lets you insert whatever values you'd use in CSS for a given tag, if you're not going to use a stylesheet outright (which you totally should, but I get that there are such things as boss constraints). The table border attribute just widens or narrows the browser's native table rendering, which varies quite a lot between browsers, but a bunch of them use the nasty web-circa-1994 metallic shadow look.
The other day, our client decided this form I'm working on should have a red 'OK' button. After googling I learned how to do that using CSS. Unfortunately, that caused other default behaviors of the button to go away (such as the border changing color when the user mouses over it), but the article showed how to recreate them using CSS.
Generally, my rule for CSS has been "use the stylesheet if you're doing something more than once." Perhaps I should use the stylesheet at other times too.
My rule for CSS is "use a stylesheet," but I'm easily confused.
My rule for CSS is "use a stylesheet,"
Yeah, this. No styling in content markup -- you may think you're only going to use a red button in one place (but, REALLY? silly client. Red means cancel, not OK), but then you end up having to recreate it each your wacky client decides it should be on another page too... If you never do that stuff in the body, you don't have to remember which place it is, plus you're ready to not screw things up when your IE-only app ends up being used in other browsers or totally different devices sometime 3 versions down the road.