Topic: How to create border around title in Ruby

Hi all, I am learning Ruby on rails for the first time and I was wondering does anybody know how to create borders for titles in ruby on rails?  I am using the "th" command but it gives me error all the time.Thanks

Re: How to create border around title in Ruby

i don't hav any idea what you re talking about. HTML? the <th> tag?

what titles? What borders? That would be a job for CSS. and what does it have to do with rails then?

Re: How to create border around title in Ruby

<th> is an HTML element: table header. It's not Rails' "job" to add borders, colors, etc... To customize looks, you should use CSS. I recommend reading some of the W3C docs or search Google for "CSS table customization".

Also, the moderator should definitely move this thread somewhere else. It's obviously *not* "Application Theory or Strategy". tongue


Last edited by levifig (2009-04-22 22:52:24)

Re: How to create border around title in Ruby


OK if you want a border around something, you need to use a little CSS in your template.

So in your rails template file (let's imagine that it's called application.html.erb) put something like this:

<ul class="border">

Then in your stylesheet add something like this:

border:1px solid #222;

This will put a border around the whole unordered list.  If you want borders around the individual <li> tags, then just specify that in your CSS file like so:

border:1px solid #222;

A couple of things, I'm not sure why you were using the <th> tag, you can do this without it, just use <li>.  But it doesn't really matter much as you can make most tags act the way you want them to.....

hope this helps

Last edited by dweebazoid (2009-04-30 11:11:52)