@@ -29,6 +29,9 @@ use crate::html::highlight;
2929use crate :: html:: layout:: Page ;
3030use crate :: html:: markdown:: MarkdownSummaryLine ;
3131
32+ const ITEM_TABLE_OPEN : & ' static str = "<div class=\" item-table\" >" ;
33+ const ITEM_TABLE_CLOSE : & ' static str = "</div>" ;
34+
3235pub ( super ) fn print_item ( cx : & Context < ' _ > , item : & clean:: Item , buf : & mut Buffer , page : & Page < ' _ > ) {
3336 debug_assert ! ( !item. is_stripped( ) ) ;
3437 // Write the breadcrumb trail header for the top
@@ -263,14 +266,15 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
263266 curty = myty;
264267 } else if myty != curty {
265268 if curty. is_some ( ) {
266- w. write_str ( "</table>" ) ;
269+ w. write_str ( ITEM_TABLE_CLOSE ) ;
267270 }
268271 curty = myty;
269272 let ( short, name) = item_ty_to_strs ( myty. unwrap ( ) ) ;
270273 write ! (
271274 w,
272275 "<h2 id=\" {id}\" class=\" section-header\" >\
273- <a href=\" #{id}\" >{name}</a></h2>\n <table>",
276+ <a href=\" #{id}\" >{name}</a></h2>\n {}",
277+ ITEM_TABLE_OPEN ,
274278 id = cx. derive_id( short. to_owned( ) ) ,
275279 name = name
276280 ) ;
@@ -283,14 +287,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
283287 match * src {
284288 Some ( ref src) => write ! (
285289 w,
286- "<tr><td ><code>{}extern crate {} as {};" ,
290+ "<div class= \" item-left \" ><code>{}extern crate {} as {};" ,
287291 myitem. visibility. print_with_space( myitem. def_id, cx) ,
288292 anchor( myitem. def_id. expect_real( ) , & * src. as_str( ) , cx) ,
289293 myitem. name. as_ref( ) . unwrap( ) ,
290294 ) ,
291295 None => write ! (
292296 w,
293- "<tr><td ><code>{}extern crate {};" ,
297+ "<div class= \" item-left \" ><code>{}extern crate {};" ,
294298 myitem. visibility. print_with_space( myitem. def_id, cx) ,
295299 anchor(
296300 myitem. def_id. expect_real( ) ,
@@ -299,7 +303,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
299303 ) ,
300304 ) ,
301305 }
302- w. write_str ( "</code></td></tr >" ) ;
306+ w. write_str ( "</code></div >" ) ;
303307 }
304308
305309 clean:: ImportItem ( ref import) => {
@@ -326,10 +330,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
326330
327331 write ! (
328332 w,
329- "<tr class=\" {stab}{add}import-item\" >\
330- <td>< code>{vis}{imp}</code></td >\
331- <td class= \" docblock-short \" >{stab_tags}</td >\
332- </tr >",
333+ "<div class=\" item-left {stab}{add}import-item\" >\
334+ <code>{vis}{imp}</code>\
335+ </div >\
336+ <div class= \" item-right docblock-short \" >{stab_tags}</div >",
333337 stab = stab. unwrap_or_default( ) ,
334338 add = add,
335339 vis = myitem. visibility. print_with_space( myitem. def_id, cx) ,
@@ -358,11 +362,11 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
358362 let doc_value = myitem. doc_value ( ) . unwrap_or_default ( ) ;
359363 write ! (
360364 w,
361- "<tr class=\" {stab}{add}module-item\" >\
362- <td>< a class=\" {class}\" href=\" {href}\" \
363- title=\" {title}\" >{name}</a>{unsafety_flag}</td> \
364- <td class= \" docblock-short \" >{stab_tags}{docs}</td >\
365- </tr >",
365+ "<div class=\" item-left {stab}{add}module-item\" >\
366+ <a class=\" {class}\" href=\" {href}\" \
367+ title=\" {title}\" >{name}</a>{unsafety_flag}\
368+ </div >\
369+ <div class= \" item-right docblock-short \" >{stab_tags}{docs}</div >",
366370 name = * myitem. name. as_ref( ) . unwrap( ) ,
367371 stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
368372 docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
@@ -382,7 +386,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
382386 }
383387
384388 if curty. is_some ( ) {
385- w. write_str ( "</table>" ) ;
389+ w. write_str ( ITEM_TABLE_CLOSE ) ;
386390 }
387391}
388392
0 commit comments