Page 1 of 1
Getting a table in a div
Posted: Thu Mar 05, 2015 7:10 am
by lizat
Dear madcaps,
I want my table indented by 40px. i thought I should use a dive and have the table inside. But how do I get the table in the div? Or is there another-better way?
Thank you,
liz
Re: Getting a table in a div
Posted: Thu Mar 05, 2015 8:41 pm
by wclass
I'd use a div.
Normally, I'd say just select the table using the structure bars and click TAB or the groups button (Home ribbon, Paragraphs) to group into a div.
However, just noticed that you can't do this with a table. You can if you select the table AND the following paragraph.
This looks like a bug to me.
Re: Getting a table in a div
Posted: Fri Mar 06, 2015 2:36 am
by lizat
Thank you, that's a relief I was sure I did it in the previous release.
I agree I think it's a bug, is raising it here enough or should I alert Madcap some other way?
Thanks..................... liz
Re: Getting a table in a div
Posted: Fri Mar 06, 2015 3:07 am
by wclass
You can report bugs here:
https://www.madcapsoftware.com/feedback/bugs.aspx
I think the easiest way is to go to the Help ribbon tab in Flare and click "Report a bug" (on the far right)
Re: Getting a table in a div
Posted: Fri Mar 06, 2015 3:25 am
by ChoccieMuffin
If you want ALL your tables indented by this much, you could modify the <table> tag, or create a class for those you want to indent. Then you can apply the class to tables just as you would apply a class to a paragraph.
Re: Getting a table in a div
Posted: Mon Mar 09, 2015 12:22 am
by DocuWil
Or ... just go into the text editor and set the margin-left. That's what I do:
<table style="margin-left: 5mm;margin-right: auto;capti ............>
Re: Getting a table in a div
Posted: Mon Mar 09, 2015 4:47 am
by Nita Beck
With respect, Wil, using inline formatting to set the table's left margin is not a best practice if the table is intended for different types of output. That 5mm left margin might be OK for one type of output such as print, but not good for another type of output such as online. It's better to create a class of table (in the appropriate medium) with a 5mm left margin and then apply that class to the table.
I routinely include a generic class ".Indent" in my style sheet that sets a modest left margin. Its being a generic class, I can apply it to pretty much anything. And if I ever want to change just how wide or narrow the indent is, I just need to change the style, rather than having to find and adjust all those places where inline formatting is present.
Re: Getting a table in a div
Posted: Mon Mar 09, 2015 6:38 am
by DocuWil
Sorry, of course you are right.
It was just a short solution.
I use classes from 05 to 25mm indentation. Example:
Code: Select all
table.Protocol_15mm
{
border-collapse: collapse;
margin-right: auto;
caption-side: top;
margin-left: 15mm;
}
Re: Getting a table in a div
Posted: Mon Mar 09, 2015 8:46 am
by Lydia
I don't agree that you cannot put a table in a div.
If you click the table tag bar on the left of the topic, you select all cells, not the table. Right-click the table tag bar and then you have the option to selec the cells or the table. Select the table here and you will be able to put it in a div. At least that works for me.
Regarding indentation: if you have different levels of indentation to work with, I would use a div. When needing the next level of indentation you can nest your divs. That way all levels would have the same indentation increment.
Re: Getting a table in a div
Posted: Mon Mar 09, 2015 2:15 pm
by wclass
Thanks @Lydia, I hadn't spotted that selection difference (though I'd prefer the structure bar to select the whole table).
Re: Getting a table in a div
Posted: Mon Mar 09, 2015 11:37 pm
by DocuWil
Thanks Lydia,
Never thought on that solution. Great!
Re: Getting a table in a div
Posted: Tue Mar 10, 2015 2:03 am
by Lydia
@ Margret: I agree, at least it would be nice if the user can change the behavior. One more option to select a table: add that command to the Quick Access Toolbar. Then, when your cursor is somewhere in the table, clicking that button will select the whole table.
@ Wil: nice idea, isn't it? It's from one of Mike Hamilton's webinars about CSS. Worth the time, those webinars, learning something new all the time.
Re: Getting a table in a div
Posted: Tue Mar 10, 2015 6:45 am
by dorcutt
Setting up complex selectors to handle indenting is also a good idea, and maybe even a better one. Personally speaking, I know that having drop down text areas can make using Divs for other purposes much more complicated.
Re: Getting a table in a div
Posted: Tue Mar 31, 2015 6:43 am
by 2bemused
If you are comfortable with working in the text editor you can insert '<div class="your_div_class">' '</div>' tags before/after the table tags, and create your own div tag in the css.
Philip