Fix output of table borders for XHTML. Fixes bug #10154.

This commit is contained in:
Richard Heck 2016-07-30 19:41:51 -04:00
parent eeb6b5b153
commit e2fa3cb6ef
3 changed files with 17 additions and 7 deletions

View File

@ -618,3 +618,16 @@ End
InsetLayout PrintNomencl
HTMLTag h2
End
InsetLayout Tabular
HTMLStyle
table {
border-collapse: collapse;
display: inline-block;
}
td {
border: 1px solid black;
padding: 0.5ex;
}
EndHTMLStyle
End

View File

@ -5092,13 +5092,7 @@ docstring InsetTabular::xhtml(XHTMLStream & xs, OutputParams const & rp) const
void InsetTabular::validate(LaTeXFeatures & features) const
{
tabular.validate(features);
// FIXME XHTML
// It'd be better to be able to get this from an InsetLayout, but at present
// InsetLayouts do not seem really to work for things that aren't InsetTexts.
if (features.runparams().flavor == OutputParams::HTML)
features.addCSSSnippet(
"table { border: 1px solid black; display: inline-block; }\n"
"td { border: 1px solid black; padding: 0.5ex; }");
features.useInsetLayout(getLayout());
}

View File

@ -981,6 +981,9 @@ public:
void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
///
virtual bool usePlainLayout() const { return true; }
///
docstring layoutName() const { return from_ascii("Tabular"); }
///
InsetTabular * asInsetTabular() { return this; }